@echo off
set CurrentPath=%~dp0
set P1Path=
:begin
for /f "tokens=1,* delims=\" %%i in ("%CurrentPath%") do (set content=%%i&&set CurrentPath=%%j)
if "%P1Path%%content%\" == "%~dp0" goto end
set P1Path=%P1Path%%content%\
goto begin
:end

For /f "tokens=1-2 delims=: skip=1 eol=#" %%i in (%P1Path%JM_config) do (echo %%i %%j
echo "jmeter -n -t %%j -JthreadNum=100 -l result.jtl -e -o report"
ssh administrator@%%i "cd C:\Users\Administrator\jmeterEnv\Matset_jmx & jmeter -n -t %%j -JthreadNum=100 -l result.jtl -e -o report"
)


pause

rem IN 的括号里面以逗号分隔   %~dp0   a2.bat 必须在当前执行脚本的同级目录下
:: jmeter -n -t test.jmx -R agent节点ip:端口 -l result.jtl -e -o report

:: onlyOneRow 结尾的是只运行配置文件的第一组，第2行数据